import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

import 'app_color.dart';

//figd_r9R608-N5EHBN23lakiwBCdDLBzFGxCUn0e7IDJz
abstract class AppTheme {
  static ThemeData setTheme() {
    return ThemeData(
      // fontFamily: "Poppins",
      textSelectionTheme: const TextSelectionThemeData(
        cursorColor: AppColor.primary,
        selectionColor: AppColor.primary,
        selectionHandleColor: AppColor.primary,
      ),
      // textTheme: const TextTheme(
      //   bodyLarge: TextStyle(fontFamily: 'Poppins'),
      //   bodySmall: TextStyle(fontFamily: 'Poppins'),
      //   bodyMedium: TextStyle(fontFamily: 'Poppins'),
      //   displayLarge: TextStyle(fontFamily: 'Poppins'),
      // ),
      inputDecorationTheme: InputDecorationTheme(
        labelStyle: const TextStyle(
          // fontFamily: 'Poppins',
          fontSize: 14,
          color: Colors.white,
        ),
        hintStyle: TextStyle(
          // fontFamily: 'Poppins',
          color: const Color(0x99FFFFFF),
          fontSize: 14.sp,
        ),
      ),
      colorScheme: ColorScheme.fromSeed(
          seedColor: Color(0xFF5D3FD3), brightness: Brightness.light),
      primaryColor: Color(0xFF5D3FD3),
      scrollbarTheme: ScrollbarThemeData(
        thumbColor: MaterialStateProperty.all(Colors.black.withOpacity(0.3)),
      ),
      scaffoldBackgroundColor: Colors.white,
      bottomNavigationBarTheme: const BottomNavigationBarThemeData(
        backgroundColor: Colors.white,
      ),
      useMaterial3: true,
      splashColor: Colors.transparent,
      highlightColor: Colors.transparent,
      splashFactory: NoSplash.splashFactory,
    );
  }

  // 为Imaginify应用添加特定的深色主题
  static ThemeData setImaginifyTheme() {
    return ThemeData(
      // 设置Outfit为默认字体
      
      brightness: Brightness.dark,
      scaffoldBackgroundColor: Color(0xFF100F1A),
      primaryColor: Color(0xFF5D3FD3),
      colorScheme: ColorScheme.dark(
        primary: Color(0xFF5D3FD3),
        secondary: Color(0xFF9E86E8),
        surface: Color(0xFF27272E),
        background: Color(0xFF171626),
        error: Colors.red.shade700,
      ),
      // 设置全局光标颜色为项目主题色
      textSelectionTheme: TextSelectionThemeData(
        cursorColor: AppColor.primary,
        selectionColor: AppColor.primary.withOpacity(0.3),
        selectionHandleColor: AppColor.primary,
      ),
      inputDecorationTheme: InputDecorationTheme(
        filled: true,
        // fillColor:const Color(0xFF27272E),
        fillColor: Colors.transparent,
        border: OutlineInputBorder(
          borderRadius: BorderRadius.circular(12),
          borderSide: BorderSide.none,
        ),
        enabledBorder: OutlineInputBorder(
          borderRadius: BorderRadius.circular(12),
          borderSide: BorderSide.none,
        ),
        focusedBorder: OutlineInputBorder(
          borderRadius: BorderRadius.circular(12),
          borderSide: BorderSide(color: Color(0xFF5D3FD3), width: 1.5),
        ),
        hintStyle: TextStyle(
          color: Color(0xFFA1A1AA),
        ),
      ),
      textTheme: TextTheme(
        bodyLarge: TextStyle(color: Colors.white, fontFamily: 'Outfit'),
        bodyMedium: TextStyle(color: Colors.white, fontFamily: 'Outfit'),
        bodySmall: TextStyle(color: Color(0xFFA1A1AA), fontFamily: 'Outfit'),
        displayLarge: TextStyle(color: Colors.white, fontFamily: 'Outfit'),
        displayMedium: TextStyle(color: Colors.white, fontFamily: 'Outfit'),
        displaySmall: TextStyle(color: Colors.white, fontFamily: 'Outfit'),
        headlineLarge: TextStyle(color: Colors.white, fontFamily: 'Outfit'),
        headlineMedium: TextStyle(color: Colors.white, fontFamily: 'Outfit'),
        headlineSmall: TextStyle(color: Colors.white, fontFamily: 'Outfit'),
        titleLarge: TextStyle(color: Colors.white, fontFamily: 'Outfit'),
        titleMedium: TextStyle(color: Colors.white, fontFamily: 'Outfit'),
        titleSmall: TextStyle(color: Colors.white, fontFamily: 'Outfit'),
        labelLarge: TextStyle(color: Colors.white, fontFamily: 'Outfit'),
        labelMedium: TextStyle(color: Colors.white, fontFamily: 'Outfit'),
        labelSmall: TextStyle(color: Color(0xFFA1A1AA), fontFamily: 'Outfit'),
      ),
      checkboxTheme: CheckboxThemeData(
        fillColor: MaterialStateProperty.resolveWith((states) {
          if (states.contains(MaterialState.selected)) {
            return Color(0xFF5D3FD3);
          }
          return Colors.transparent;
        }),
        side: BorderSide(color: Color(0xFFA1A1AA)),
        shape: RoundedRectangleBorder(
          borderRadius: BorderRadius.circular(4),
        ),
      ),
      elevatedButtonTheme: ElevatedButtonThemeData(
        style: ElevatedButton.styleFrom(
          backgroundColor: Color(0xFF5D3FD3),
          foregroundColor: Colors.white,
          shape: RoundedRectangleBorder(
            borderRadius: BorderRadius.circular(12),
          ),
          padding: EdgeInsets.symmetric(vertical: 16),
          minimumSize: Size(double.infinity, 56),
        ),
      ),
      dividerTheme: DividerThemeData(
        color: Color(0xFF3F3F46),
        thickness: 1,
      ),
      textButtonTheme: TextButtonThemeData(
        style: TextButton.styleFrom(
          foregroundColor: Color(0xFF5D3FD3),
          padding: EdgeInsets.zero,
          minimumSize: Size(0, 0),
          tapTargetSize: MaterialTapTargetSize.shrinkWrap,
        ),
      ),
      useMaterial3: true,
      splashColor: Colors.transparent,
      highlightColor: Colors.transparent,
      splashFactory: NoSplash.splashFactory,
    );
  }
}
